<template>
	<view class="">
		<view class="wallpaper-list">
			<view @tap="openImg(item,index)" class="wallpaper-item" v-for="(item,index) in wallpaperList" :key="index">
				<image :src="item.src" style="width: 100%;height: 350rpx;background: #ccc;" mode="aspectFill"></image>
			</view>
		</view>
		
		<modal ref="modal"></modal>
	</view>
</template>

<script>
	export default {
		props:{
			wallpaperList:{
				type:Array,
				default:()=>[]
			}
		},
		data(){
			return {
				
			}
		},
		methods:{
			openImg(item,index){
				var vipConfig = uni.getStorageSync('vipConfig')
				var user = uni.getStorageSync('user')
				if (!user && vipConfig.isSearchLogin) {
					this.$refs['modal'].modalName = 'Modal'
					return
				}
				uni.navigateTo({
					url:"/pages/common/works-details?framer_id="+item.framer_id  + "&up_img=" + item.src
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.wallpaper-list{
		// display: flex;
		// align-items: center;
		// flex-wrap: wrap;
		
		overflow: auto;
		white-space: nowrap;
		.wallpaper-item{
			display: inline-block;
			width: 31%;
			margin: 20rpx 2.333% 20rpx 0;
			image{
				border-radius: 10rpx;
			}
		}
	}
</style>